import junit.framework.TestCase;

public class ComplexTest extends TestCase {

    Complex a = new Complex(7, 9);
    Complex b = new Complex(-2, -3);
    public void testEquals() {
        assertEquals(true, a.equals(a));
        assertEquals(false, b.equals(a));
    }
    public void testToString() {
        assertEquals("7+9i", a.toString());
        assertEquals("-2-3i", b.toString());
    }
    public void testComplexAdd() {
        assertEquals("5+6i",a.ComplexAdd(b).toString());
        assertEquals("-4-6i",b.ComplexAdd(b).toString());
    }
    public void testComplexSub() {
        assertEquals("9+12i",a.ComplexSub(b).toString());
        assertEquals("0",b.ComplexSub(b).toString());
    }
    public void testComplexMulti() {
        assertEquals("-32+126i",a.ComplexMulti(a).toString());
        assertEquals("13-39i",a.ComplexMulti(b).toString());
    }
    public void testComplexDiv() {
        assertEquals("1",a.ComplexDiv(a).toString());
    }
}